<template>
    <div class="newlist">
    
        <ul class="mui-table-view" >

            <li class="mui-table-view-cell mui-media" v-for="item in newlist" :key="item.id">
                <router-link  :to="'/new/newsinfo/'+item.id">
                <img class="mui-media-object mui-pull-left" :src="item.img_url"  alt="">
                <div class="new-info">
                    <h3>{{item.title}}</h3>
                    <p class="new-info-date">
                        <span>{{item.add_time|dateFormat}}</span>
                        <span>{{item.click}} 次</span>
                    </p>
                </div>
                </router-link>
            </li>
       </ul>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                newlist: []
            }
        },
        created() {
            this.getnewlist()
        },
        methods: {
            async getnewlist() {
                const {
                    data
                } = await this.$http.get('api/getnewslist')
                if (data.status === 0) this.newlist = data.message
            }
        },
    }
</script>
<style lang="scss" scoped>
    .newlist {
        .mui-table-view {
            .mui-table-view-cell {
                .new-info {
                    h3 {
                        font-size: 13px;
                    }
                    .new-info-date {
                        display: flex;
                        justify-content: space-between;
                        font-size: 12px;
                    }
                }
            }
        }
    }
</style>